package com.fatcat.easybuy.mapper;

import com.fatcat.easybuy.pojo.EasyBuyOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Fatcat
 * @description 针对表【easybuy_order】的数据库操作Mapper
 * @createDate 2025-09-10 10:52:53
 * @Entity generator.domain.EasybuyOrder
 */
@Mapper
@Repository
public interface EasyBuyOrderMapper {

    /**
     * 查询所有订单
     * @return
     */
    List<EasyBuyOrder> selectAllOrder( Map<String,Object> params);

    /**
     * 新增订单
     * @param easyBuyOrder
     * @return
     */
    int addOrder(EasyBuyOrder easyBuyOrder);

    /**
     * 根据订单号关闭订单
     */
    int closeOrder(String serialNumber);
    /**
     * 根据订单号查询订单
     */
    EasyBuyOrder selectOrderBySerialNumber(String outTradeNo);

    /**
     * 更新订单
     * @param easyBuyOrder
     * @return
     */
    int updateOrder(EasyBuyOrder easyBuyOrder);


    /**
     * 根据订单id查询订单
     * @param orderId
     * @return
     */
    EasyBuyOrder selectOrderById(Long orderId);
    /**
     * 删除订单
     * @param orderId
     * @return
     */
    int deleteOrder(Long orderId);
    /**
     * 修改订单状态
     */
    int changeStatus(@Param("orderId") Long orderId, @Param("status") Integer status);
}
